package cn.xiaolang.function.jdk8.functional_interface;

import java.util.function.Consumer;
import java.util.function.Function;

/**
 * 功能性接口：Function<T,R>
 * <p>
 * 对类型T参数操作，返回R类型参数，包含方法 R apply（T t）
 * </p>
 *
 * @author fuhw/Dean
 * @date 2019-07-19
 */
public class FunctionInterface {

    public static void main(String[] args) {
        System.out.println(handle(100D, a -> "hello,boy,ni get: " + a));
    }


    private static String handle(Double param, Function<Double, String> function) {
        return function.apply(param);
    }
}
